package br.org.etec.dotcao.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name = "teventcomment")
@Entity
public class EventComment extends Comment {

	private static final long serialVersionUID = 1L;

	@ManyToOne
	@JoinColumn(name = "event")
	private Event event;

	@ManyToOne
	@JoinColumn(name = "target")
	private EventComment target;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "target")
	private List<EventComment> comments;

	public Event getEvent() {
		return event;
	}

	public void setEvent(Event event) {
		this.event = event;
	}

	public EventComment getTarget() {
		return target;
	}

	public void setTarget(EventComment target) {
		this.target = target;
	}

	public List<EventComment> getComments() {
		return comments;
	}

	public void setComments(List<EventComment> comments) {
		this.comments = comments;
	}

}